package com.data.mapper;

import com.data.entity.${table.className};
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface ${table.className}Mapper extends BaseMapper<${table.className}> {

    //需要把 ` 替换为: " 然后删除#'{page}',#'{limit}' 的单引号
    @Select({`<script>` ,
                "SELECT * FROM ${table.tableName}  ",
                "order by createtime desc limit #'{page}',#'{limit}'" ,
            `</script>`})
   List<${table.className}> listPage(@Param("page")Integer page,
                                     @Param("limit")Integer limit);

    @Select({`<script>` ,
            "SELECT count(1) FROM ${table.tableName}  ",
            `</script>`})
   int count();

}
